# Maintainer: Levente Polyak <anthraxx[at]archlinux[dot]org>

pkgname=python-feedgen
pkgver=0.9.0
pkgrel=4
pkgdesc='Python module to generate ATOM feeds, RSS feeds and Podcasts'
url='https://lkiesow.github.io/python-feedgen'
arch=('any')
license=('BSD')
depends=('python' 'python-dateutil' 'python-lxml')
makedepends=('python-setuptools' 'python-sphinx')
source=(https://github.com/lkiesow/python-feedgen/archive/v${pkgver}/${pkgname}-${pkgver}.tar.gz)
sha512sums=('5b466d0b7e9d3b427969f0623aa92e8eb5c9eebb46e416ad767267fa52ca2fe4561ee1e7478839d372ec5c96d2333c6232e6b34a68b77f740b6b7f263d2ab8e4')
b2sums=('91802322b620b5e0f297da870c97934cfc7bc2187ea89d2ac5db1fa69424dfc97abb457e69fef7ea68fba7fd0e4cdb531d44b2b450dc396a5658272185b99602')

build() {
  cd ${pkgname}-${pkgver}
  python setup.py build
  make -j1 -C doc man text
}

check() {
  cd ${pkgname}-${pkgver}
  python setup.py test
}

package() {
  cd ${pkgname}-${pkgver}
  python setup.py install --root="${pkgdir}" --optimize=1 --skip-build
  install -Dm 644 readme.rst SECURITY.rst  -t "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 license.bsd license.lgpl -t "${pkgdir}/usr/share/licenses/${pkgname}"
  install -d "${pkgdir}/usr/share/doc/${pkgname}"
  cp -r doc/_build/text/* "${pkgdir}/usr/share/doc/${pkgname}"
  install -Dm 644 doc/_build/man/pyFeedGen.tex.1 "${pkgdir}/usr/share/man/man1/${pkgname}.1"
}

# vim: ts=2 sw=2 et:
